# -*- coding: utf-8 -*-

from PyQt5.QtWidgets import QWidget, QPushButton, QTextEdit, QApplication, QVBoxLayout
import sys


class Click(QWidget):
    def __init__(self):
        super(Click, self).__init__()

        self.text = QTextEdit()
        self.btn1 = QPushButton("点击按钮触发")

        layout = QVBoxLayout()
        layout.addWidget(self.text)
        layout.addWidget(self.btn1)

        self.btn1.clicked.connect(self.click)

        self.setLayout(layout)

    def click(self):
        self.text.setPlaceholderText("点击成功")


if __name__ == '__main__':
    app = QApplication(sys.argv)
    c = Click()
    c.show()
    sys.exit(app.exec_())
